package com.sss.hloster0702;

import java.lang.reflect.Method;
import java.util.Scanner;

public class TestRef {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入一个Java类全名：");
		String cName = sc.next();
		showMethods(cName);

	}

	public static void showMethods(String name) {
		try {
			Class c = Class.forName(name);
			Method m[] = c.getDeclaredMethods();
			System.out.println("该Java类的方法有：");
			for (int i = 0; i < m.length; i++) {
				System.out.println(m[i].toString());
			}
		} catch (Exception e) {

			e.printStackTrace();
		}
	}
}
